﻿@page "/Account/Logout"
@using Blazored.LocalStorage;
@inject ILocalStorageService local

@code {
    /// <summary>
    /// 当前Token信息
    /// </summary>
    [CascadingParameter]
    private ITokenContext? Context { get; set; }

    [Inject]
    NavigationManager nav { get; set; }


    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected async override void OnInitialized()
    {

        base.OnInitialized();
        //删除Session
        Context.ClearSession();
        //清空当前用户
        await local.RemoveItemAsync(ClientAppKey.CurrentUser);
        //跳转登录
        nav.NavigateTo("/Account/Login");
    }

}
